<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>PHP编译参数 | SmileYi</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="常用参数1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950--prefix=/usr/local/php                             PHP 安装目录 --with-apxs2=/usr/local/apache/bin/apxs">
<meta name="keywords" content="总结">
<meta property="og:type" content="article">
<meta property="og:title" content="PHP编译参数">
<meta property="og:url" content="http://smileyi.gitee.io/2019/04/05/PHP编译参数/index.html">
<meta property="og:site_name" content="SmileYi">
<meta property="og:description" content="常用参数1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950--prefix=/usr/local/php                             PHP 安装目录 --with-apxs2=/usr/local/apache/bin/apxs">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-04-05T12:46:17.368Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="PHP编译参数">
<meta name="twitter:description" content="常用参数1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950--prefix=/usr/local/php                             PHP 安装目录 --with-apxs2=/usr/local/apache/bin/apxs">
  
    <link rel="alternate" href="/atom.xml" title="SmileYi" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">SmileYi</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">只要学会破罐子破摔 世界就会豁然开朗</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">首页</a>
        
          <a class="main-nav-link" href="/archives">归档</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="搜索"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://smileyi.gitee.io"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-PHP编译参数" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/04/05/PHP编译参数/" class="article-date">
  <time datetime="2019-04-05T12:36:25.000Z" itemprop="datePublished">2019-04-05</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/PHP/">PHP</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      PHP编译参数
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h4 id="常用参数"><a href="#常用参数" class="headerlink" title="常用参数"></a>常用参数</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br></pre></td><td class="code"><pre><span class="line">--prefix=/usr/local/php                             PHP 安装目录 </span><br><span class="line">--with-apxs2=/usr/local/apache/bin/apxs             Apache的PHP模块</span><br><span class="line">--with-config-file-path=/usr/local/php/etc          指定php.ini位置</span><br><span class="line">--with-MySQL=/usr/local/mysql                       mysql安装目录，对mysql的支持</span><br><span class="line">--with-MySQLi=/usr/local/mysql/bin/mysql_config     mysqli文件目录,优化支持</span><br><span class="line">--enable-safe-mode                                  打开安全模式</span><br><span class="line">--enable-ftp                                        打开ftp的支持</span><br><span class="line">--enable-zip                                        打开对zip的支持</span><br><span class="line">--with-bz2                                          打开对bz2文件的支持                        </span><br><span class="line">--with-jpeg-dir                                     打开对jpeg图片的支持</span><br><span class="line">--with-png-dir                                      打开对png图片的支持</span><br><span class="line">--with-freetype-dir                                 打开对freetype字体库的支持</span><br><span class="line">--without-iconv                                     关闭iconv函数，种字符集间的转换</span><br><span class="line">--with-libXML-dir                                   打开libxml2库的支持</span><br><span class="line">--with-XMLrpc                                       打开xml-rpc的c语言</span><br><span class="line">--with-zlib-dir                                     打开zlib库的支持</span><br><span class="line">--with-gd                                           打开gd库的支持</span><br><span class="line">--enable-gd-native-ttf                              支持TrueType字符串函数库</span><br><span class="line">--with-curl                                         打开curl浏览工具的支持</span><br><span class="line">--with-curlwrappers                                 运用curl工具打开url流</span><br><span class="line">--with-ttf                                          打开freetype1.*的支持，可以不加了</span><br><span class="line">--with-xsl                                          打开XSLT 文件支持，扩展了libXML2库 ，需要libxslt软件</span><br><span class="line">--with-gettext                                      打开gnu 的gettext 支持，编码库用到</span><br><span class="line">--with-pear                                         打开pear命令的支持，PHP扩展用的</span><br><span class="line">--enable-calendar                                   打开日历扩展功能</span><br><span class="line">--enable-mbstring                                   多字节，字符串的支持</span><br><span class="line">--enable-bcmath                                     打开图片大小调整,用到zabbix监控的时候用到了这个模块</span><br><span class="line">--enable-sockets                                    打开 sockets 支持</span><br><span class="line">--enable-exif                                       图片的元数据支持</span><br><span class="line">--enable-magic-quotes                               魔术引用的支持</span><br><span class="line">--disable-rpath                                     关闭额外的运行库文件</span><br><span class="line">--disable-debug                                     关闭调试模式</span><br><span class="line">--with-mime-magic=/usr/share/file/magic.mime        魔术头文件位置</span><br><span class="line">--with-gmp</span><br><span class="line">--enable-inline-optimization</span><br><span class="line">--with-openssl                                      openssl的支持，加密传输时用到的</span><br><span class="line">--enable-dbase</span><br><span class="line">--with-pcre-dir=/usr/local/bin/pcre-config          perl的正则库案安装位置</span><br><span class="line">--disable-dmalloc</span><br><span class="line">--with-gdbm                                         dba的gdbm支持</span><br><span class="line">--enable-sigchild</span><br><span class="line">--enable-sysvsem</span><br><span class="line">--enable-sysvshm</span><br><span class="line">--enable-zend-multibyte                             支持zend的多字节</span><br><span class="line">--enable-mbregex</span><br><span class="line">--enable-wddx</span><br><span class="line">--enable-shmop</span><br><span class="line">--enable-soap</span><br><span class="line">--with-mcrypt                                       mcrypt算法     </span><br><span class="line">--with-mhash                                        mhash算法</span><br></pre></td></tr></table></figure>
<h4 id="CGI方式相关参数"><a href="#CGI方式相关参数" class="headerlink" title="CGI方式相关参数"></a>CGI方式相关参数</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">--enable-fpm                    打上PHP-fpm 补丁后才有这个参数，CGI方式安装的启动程序</span><br><span class="line">--enable-fastCGI                支持fastcgi方式启动PHP</span><br><span class="line">--enable-force-CGI-redirect     同上 ,帮助里没有解释</span><br><span class="line">--with-ncurses                  支持ncurses 屏幕绘制以及基于文本终端的图形互动功能的动态库</span><br><span class="line">--enable-pcntl                  freeTDS需要用到的，可能是链接mssql 才用到</span><br></pre></td></tr></table></figure>
<h4 id="实例"><a href="#实例" class="headerlink" title="实例"></a>实例</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">./configure --prefix=/usr/local/php \</span><br><span class="line">--with-config-file-path=/usr/local/php/etc \</span><br><span class="line">--with-mysql-sock=/var/run/mysql/mysql.sock \</span><br><span class="line">--with-mhash \</span><br><span class="line">--with-openssl \</span><br><span class="line">--with-mysqli=shared,mysqlnd \</span><br><span class="line">--with-pdo-mysql=shared,mysqlnd \</span><br><span class="line">--with-gd \</span><br><span class="line">--with-iconv \</span><br><span class="line">--with-zlib \</span><br><span class="line">--enable-zip \</span><br><span class="line">--enable-inline-optimization \</span><br><span class="line">--disable-debug \</span><br><span class="line">--disable-rpath \</span><br><span class="line">--enable-shared \</span><br><span class="line">--enable-xml \</span><br><span class="line">--enable-bcmath \</span><br><span class="line">--enable-shmop \</span><br><span class="line">--enable-mbstring \</span><br><span class="line">--enable-pcntl \</span><br><span class="line">--enable-sockets \</span><br><span class="line">--with-xmlrpc \</span><br><span class="line">--enable-soap \</span><br><span class="line">--without-pear \</span><br><span class="line">--with-gettext \</span><br><span class="line">--enable-session \</span><br><span class="line">--with-curl \</span><br><span class="line">--with-jpeg-dir \</span><br><span class="line">--with-freetype-dir \</span><br><span class="line">--enable-fpm \</span><br><span class="line">--enable-fastcgi \</span><br><span class="line">--with-fpm-user=php \</span><br><span class="line">--with-fpm-group=php</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://smileyi.gitee.io/2019/04/05/PHP编译参数/" data-id="ck5390nrg0015kecz7gkd9k5o" class="article-share-link">分享</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/总结/">总结</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/04/07/Linux编译安装PHP-Nginx-Mysql/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Linux编译安装PHP+Nginx+Mysql
        
      </div>
    </a>
  
  
    <a href="/2019/04/05/Docker基本操作/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Docker基本操作</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">分类</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Docker/">Docker</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Linux/">Linux</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/MacOS/">MacOS</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Mysql/">Mysql</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Nginx/">Nginx</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/PHP/">PHP</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Swoole/">Swoole</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/算法/">算法</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/网络/">网络</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/原创/">原创</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/总结/">总结</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/笔记/">笔记</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/转载/">转载</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">一月 2020</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">七月 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">六月 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">四月 2019</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">三月 2019</a><span class="archive-list-count">4</span></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/01/05/Swoole之server/">swoole之server</a>
          </li>
        
          <li>
            <a href="/2020/01/02/Certbot-免费的ssl证书/">Certbot--免费的ssl证书</a>
          </li>
        
          <li>
            <a href="/2019/07/13/Nginx限流配置/">Nginx限流配置</a>
          </li>
        
          <li>
            <a href="/2019/06/23/Mysql分区/">Mysql分区</a>
          </li>
        
          <li>
            <a href="/2019/04/15/Rsa算法/">Rsa算法</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 王中艺<br>
      <a href="http://www.beian.miit.gov.cn/">京ICP备18032247号-2</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">首页</a>
  
    <a href="/archives" class="mobile-nav-link">归档</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>